home *** CD-ROM | disk | FTP | other *** search
/ Precision Software Appli…tions Silver Collection 3 / Precision Software Applications Silver Collection Volume Three (PSM) (1993).iso / music2 / mepody.exe / DELAY.C < prev    next >
Text File  |  1991-04-13  |  681b  |  29 lines

  1. /*  This is am example of function own_delay(). You can try to use
  2.     this function with MELODY MASTER's "Turbo C" output file to make
  3.     background music. First, insert your foreground operations into
  4.     this function. Second, change all "delay(" in the output file
  5.     into "own_delay(" by using Find/Replace commands. */
  6.  
  7.  
  8. #include <dos.h>
  9. own_delay(num)
  10. int num;
  11. {
  12.   struct time t,ot;
  13.   int dif;
  14. /* static YOUR_VARS;  */
  15.  
  16.   gettime(&ot);
  17.   do
  18.   {
  19.     /*
  20.       YOUR FUNCTION
  21.     */
  22.     gettime(&t);
  23.     dif = (t.ti_min * 60000 + t.ti_sec*1000 + t.ti_hund*10)
  24.       - (ot.ti_min * 60000 + ot.ti_sec*1000 + ot.ti_hund*10);
  25.   }
  26.   while (dif < num);
  27. }
  28.  
  29.